package com.albon.main;


import com.albon.sportsalarm.R;

import com.slidingmenu.lib.SlidingMenu;

import android.os.Bundle;
import android.support.v4.app.Fragment;

public class AlbonMain extends BaseActivity {
	private final String TAG = "AlbonMain";
	private Fragment mContent;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// set the Above View
				if (savedInstanceState != null)
					mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
				if (mContent == null)
					mContent = new SoccerFragment(getText(R.string.epl).toString(), "epl", 0);
				    mContent = new BaseballFragment(getText(R.string.mlb).toString(), "mlb", 0);
	
				// set the Above View
				setContentView(R.layout.content_frame);
				getSupportFragmentManager()
				.beginTransaction()
				.replace(R.id.content_frame, mContent)
				.commit();
				
				// set the Behind View
				setBehindContentView(R.layout.menu_frame);
				getSupportFragmentManager()
				.beginTransaction()
				.replace(R.id.menu_frame, new MenuFragment())
				.commit();
				
				getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
	}
	public void switchContent(Fragment fragment) {
		mContent = fragment;
		getSupportFragmentManager()
		.beginTransaction()
		.replace(R.id.content_frame, fragment)
		.commit();
		getSlidingMenu().showContent();
	}
}
